ScxV6Object.SetSecurity Method

Sets the security on a database object.

Remarks

The GetSecurity method returns the object's security as a string.

The string is comprised of the the security settings for all users configured on the object, delimited by commas.

You must have "Security" access to the object to set it's security information.

the format of the string is as follows:

<User Type>[:<Name>]:<ACL string>[,...]

The valid user types are:

Name Description
User A user. The "User" type will be followed by the user's name.
Group A user group, which zero or more users may be a member of. The "Group" type will be followed by the group's name.
Guest The guest user.
Web The guest user for web connections.
Everyone All connections have this level of access by default.

The ACL string is a list of the types of access that the user/group has on the object. It is an optional privilege group name followed by "+" and a list of two or three-letter identifiers separated by spaces.

The valid ACL identifiers are:

Identifier Description
RD Read
BRS Browse
CTL Control
OVR Override
ALM Accept Alarms
VWA View Alarms
RMA Remove Alarms
RDR Manual Redirection
UNA Unaccept Alarms
NOT Edit Notes
RET Retrieve Data
PRM Promote
TUN Tune Limits
AHS Annotate History
MHS Modify History
VHS Validate History
DIS Disable Points
DLM Disable Alarms
DCT Disable Controls
SWL Switch Line
DIA Diagnostic
EXC Exclusive Control
MEC Manage Exclusive Control
CFG Configure
SEC Security
ADM System Administration

In addition to these, a number of these are combined into privilege groups, representing common roles of system users.

Name Privileges
None No access
View RD
Operator RD BRS CTL OVR ALM VWA RMA RDR NOT RET PRM TUN AHS
Advanced RD BRS CTL OVR DIS ALM UNA VWA RMA RDR NOT RET PRM TUN AHS MHS VHS DLM DCT SWL DIA EXC MEC
Configuration RD BRS CTL OVR DIS ALM VWA RMA NOT RET PRM TUN AHS MHS VHS DLM DCT SWL DIA EXC MEC CFG
Full Every privilege

Using a null or empty string will remove any explicit security set on the object, causing it to inherit from its parent.

Example:

The following example written in VB.NET sets the security information of a point in the database.

Dim Svr As ScxV6DbClient.ScxV6Server

' Connect to the server

Svr = New ScxV6DbClient.ScxV6Server

r.Connect("MAIN", "D", "")

Dim Obj As ScxV6DbClient.ScxV6Object

Obj = Svr.FindObject("Group.Test Point")

Console.WriteLine("Before: {0}", Obj.GetSecurity())

Obj.SetSecurity("Everyone:Full", False)

Console.WriteLine("After: {0}", Obj.GetSecurity())

' Disconnect

Svr.Disconnect()

This produces the following output:

Before: Everyone:View + BRS,User:Group.Export:View + NOT,User:Group.Operator:Operator + UNA VHS,User:D:Full,Group:Group.Special Users Group:View + BRS SEC ADM

After: Everyone:Full


Disclaimer

ClearSCADA 2017 R3